http2: avoid data race on DebugGoroutines in TestGoroutineLock TestGoroutineLock sets DebugGoroutines = true. When a previous test leaves a server running after exiting, this write to DebugGoroutines can race with reads from the server. Obviously tests shouldn't leave goroutines around after they exit, but it happens and when it does it can show up here as a rare and hard-to-debug flake. DebugGoroutines is always true in tests, so there's no need to set it here. Just leave it alone. Fixes golang/go#75811 Change-Id: Iebeab2a22642cbd6867b9f4f5a171c91ea697b17 Reviewed-on: https://go-review.googlesource.com/c/net/+/710675 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Nicholas Husin <nsh@golang.org> Reviewed-by: Nicholas Husin <husin@google.com> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Nicholas Husin <nsh@golang.org> 
diff --git a/http2/gotrack_test.go b/http2/gotrack_test.go index 06db612..18b8961 100644 --- a/http2/gotrack_test.go +++ b/http2/gotrack_test.go 
@@ -11,10 +11,6 @@  )    func TestGoroutineLock(t *testing.T) { -	oldDebug := DebugGoroutines -	DebugGoroutines = true -	defer func() { DebugGoroutines = oldDebug }() - 	g := newGoroutineLock() 	g.check()